package co.gov.medellin.ssti.sub.service;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.Collection;
import java.util.List;

import javax.naming.NamingException;

import co.gov.medellin.ssti.sub.common.ConexionFactory;
import co.gov.medellin.ssti.sub.common.dao.Consultas;
import co.gov.medellin.ssti.sub.common.util.Atributo;
import co.gov.medellin.ssti.sub.model.dao.exception.DAOException;
import co.gov.medellin.ssti.sub.model.vo.AreaVO;
import co.gov.medellin.ssti.sub.model.vo.ProgramaVO;
import co.gov.medellin.ssti.sub.model.vo.SedeVO;
import co.gov.medellin.ssti.sub.model.vo.SubprogramaVO;
import co.gov.medellin.ssti.sub.model.vo.ValorFlexibleVO;
import co.gov.medellin.ssti.sub.model.vo.VflexVO;
import co.gov.medellin.ssti.sub.paoyer.administration.model.vo.UserVO;

public class ConsultasService {
	public Collection<ProgramaVO> getDetPrograma(String strcodigo)
			throws DAOException {
		Consultas consultas = null;
		try {
			Connection conn = ConexionFactory.getInstance().getConnection();
			consultas = new Consultas(conn);
			return consultas.getDetPrograma(strcodigo);
		} catch (NamingException e) {
			throw new DAOException(e);
		} catch (SQLException e) {
			throw new DAOException(e);
		} finally {
			if (consultas != null) {
				if (!consultas.isConnClosed()) {
					consultas.close();
				}
			}
		}
	}

	public Collection<SubprogramaVO> getDetSubpgr(String strsubpgr)
			throws DAOException {
		Consultas consultas = null;
		try {
			Connection conn = ConexionFactory.getInstance().getConnection();
			consultas = new Consultas(conn);
			return consultas.getDetSubpgr(strsubpgr);
		} catch (NamingException e) {
			throw new DAOException(e);
		} catch (SQLException e) {
			throw new DAOException(e);
		} finally {
			if (consultas != null) {
				if (!consultas.isConnClosed()) {
					consultas.close();
				}
			}
		}
	}

	public Collection<SedeVO> getDetSede(String strSede) throws DAOException {
		Consultas consultas = null;
		try {
			Connection conn = ConexionFactory.getInstance().getConnection();
			consultas = new Consultas(conn);
			return consultas.getDetSede(strSede);
		} catch (NamingException e) {
			throw new DAOException(e);
		} catch (SQLException e) {
			throw new DAOException(e);
		} finally {
			if (consultas != null) {
				if (!consultas.isConnClosed()) {
					consultas.close();
				}
			}
		}
	}

	public Collection<ProgramaVO> getNamePrograma(Long codeUser,
			String groupUserName, Long areaUser) throws DAOException {
		Consultas consultas = null;
		try {
			System.out.println("fk");
			Connection conn = ConexionFactory.getInstance().getConnection();
			consultas = new Consultas(conn);
			return consultas.getNamePrograma(codeUser, groupUserName, areaUser);
		} catch (NamingException e) {
			throw new DAOException(e);
		} catch (SQLException e) {
			throw new DAOException(e);
		} finally {
			if (consultas != null) {
				if (!consultas.isConnClosed()) {
					consultas.close();
				}
			}
		}
	}

	public Collection<AreaVO> getNomSubsecretaria(String strcodsecret)
			throws DAOException {
		Consultas consultas = null;
		try {
			Connection conn = ConexionFactory.getInstance().getConnection();
			consultas = new Consultas(conn);
			return consultas.getNomSubsecretaria(strcodsecret);
		} catch (NamingException e) {
			throw new DAOException(e);
		} catch (SQLException e) {
			throw new DAOException(e);
		} finally {
			if (consultas != null) {
				if (!consultas.isConnClosed()) {
					consultas.close();
				}
			}
		}
	}

	public Collection<UserVO> getUsuAdmin(String strusu) throws DAOException {
		Consultas consultas = null;
		try {
			Connection conn = ConexionFactory.getInstance().getConnection();
			consultas = new Consultas(conn);
			return consultas.getUsuAdmin(strusu);
		} catch (NamingException e) {
			throw new DAOException(e);
		} catch (SQLException e) {
			throw new DAOException(e);
		} finally {
			if (consultas != null) {
				if (!consultas.isConnClosed()) {
					consultas.close();
				}
			}
		}
	}

	public Collection<VflexVO> getMunicipios() throws DAOException {
		Consultas consultas = null;
		try {
			Connection conn = ConexionFactory.getInstance().getConnection();
			consultas = new Consultas(conn);
			return consultas.getMunicipios();
		} catch (NamingException e) {
			throw new DAOException(e);
		} catch (SQLException e) {
			throw new DAOException(e);
		} finally {
			if (consultas != null) {
				if (!consultas.isConnClosed()) {
					consultas.close();
				}
			}
		}
	}

	public int getActivarSub2(String[] param) throws DAOException {
		Consultas consultas = null;
		try {
			Connection conn = ConexionFactory.getInstance().getConnection();
			consultas = new Consultas(conn);
			return consultas.getActivarSub2(param);
		} catch (NamingException e) {
			throw new DAOException(e);
		} catch (SQLException e) {
			throw new DAOException(e);
		} finally {
			if (consultas != null) {
				if (!consultas.isConnClosed()) {
					consultas.close();
				}
			}
		}
	}

	public int getActivarPro2(String[] param) throws DAOException {
		Consultas consultas = null;
		try {
			Connection conn = ConexionFactory.getInstance().getConnection();
			consultas = new Consultas(conn);
			return consultas.getActivarPro2(param);
		} catch (NamingException e) {
			throw new DAOException(e);
		} catch (SQLException e) {
			throw new DAOException(e);
		} finally {
			if (consultas != null) {
				if (!consultas.isConnClosed()) {
					consultas.close();
				}
			}
		}
	}

	public Collection<String> getNomPrg(String strcodpro) throws DAOException {
		Consultas consultas = null;
		try {
			Connection conn = ConexionFactory.getInstance().getConnection();
			consultas = new Consultas(conn);
			return consultas.getNomPrg(strcodpro);
		} catch (NamingException e) {
			throw new DAOException(e);
		} catch (SQLException e) {
			throw new DAOException(e);
		} finally {
			if (consultas != null) {
				if (!consultas.isConnClosed()) {
					consultas.close();
				}
			}
		}
	}

	public Collection<SubprogramaVO> getInfoact(String strsubprog)
			throws DAOException {
		Consultas consultas = null;
		try {
			Connection conn = ConexionFactory.getInstance().getConnection();
			consultas = new Consultas(conn);
			return consultas.getInfoact(strsubprog);
		} catch (NamingException e) {
			throw new DAOException(e);
		} catch (SQLException e) {
			throw new DAOException(e);
		} finally {
			if (consultas != null) {
				if (!consultas.isConnClosed()) {
					consultas.close();
				}
			}
		}
	}

	public boolean valProgActivo(String strsubprg) throws DAOException {
		Consultas consultas = null;
		try {
			Connection conn = ConexionFactory.getInstance().getConnection();
			consultas = new Consultas(conn);
			return consultas.valProgActivo(strsubprg);
		} catch (NamingException e) {
			throw new DAOException(e);
		} catch (SQLException e) {
			throw new DAOException(e);
		} finally {
			if (consultas != null) {
				if (!consultas.isConnClosed()) {
					consultas.close();
				}
			}
		}
	}

	public Collection<SubprogramaVO> getInfoact2(String strsubprog)
			throws DAOException {
		Consultas consultas = null;
		try {
			Connection conn = ConexionFactory.getInstance().getConnection();
			consultas = new Consultas(conn);
			return consultas.getInfoact2(strsubprog);
		} catch (NamingException e) {
			throw new DAOException(e);
		} catch (SQLException e) {
			throw new DAOException(e);
		} finally {
			if (consultas != null) {
				if (!consultas.isConnClosed()) {
					consultas.close();
				}
			}
		}
	}

	public String Nombre(String strCod) throws DAOException {
		Consultas consultas = null;
		try {
			Connection conn = ConexionFactory.getInstance().getConnection();
			consultas = new Consultas(conn);
			return consultas.Nombre(strCod);
		} catch (NamingException e) {
			throw new DAOException(e);
		} catch (SQLException e) {
			throw new DAOException(e);
		} finally {
			if (consultas != null) {
				if (!consultas.isConnClosed()) {
					consultas.close();
				}
			}
		}
	}

	public int ObtenerCodAtriEspe(String strCod) throws DAOException {
		Consultas consultas = null;
		try {
			Connection conn = ConexionFactory.getInstance().getConnection();
			consultas = new Consultas(conn);
			return consultas.ObtenerCodAtriEspe(strCod);
		} catch (NamingException e) {
			throw new DAOException(e);
		} catch (SQLException e) {
			throw new DAOException(e);
		} finally {
			if (consultas != null) {
				if (!consultas.isConnClosed()) {
					consultas.close();
				}
			}
		}
	}

	public int getlistaGeneral(String strCod) throws DAOException {
		Consultas consultas = null;
		try {
			Connection conn = ConexionFactory.getInstance().getConnection();
			consultas = new Consultas(conn);
			return consultas.getlistaGeneral(strCod);
		} catch (NamingException e) {
			throw new DAOException(e);
		} catch (SQLException e) {
			throw new DAOException(e);
		} finally {
			if (consultas != null) {
				if (!consultas.isConnClosed()) {
					consultas.close();
				}
			}
		}
	}

	public Collection<Atributo> getAtributoGenerico(String codsub)
			throws DAOException {
		Consultas consultas = null;
		try {
			Connection conn = ConexionFactory.getInstance().getConnection();
			consultas = new Consultas(conn);
			return consultas.getAtributoGenerico(codsub);
		} catch (NamingException e) {
			throw new DAOException(e);
		} catch (SQLException e) {
			throw new DAOException(e);
		} finally {
			if (consultas != null) {
				if (!consultas.isConnClosed()) {
					consultas.close();
				}
			}
		}
	}

	public Collection<Atributo> getAtributoEspecificos(String strSubprograma,
			int opcion) throws DAOException {
		Consultas consultas = null;
		try {
			Connection conn = ConexionFactory.getInstance().getConnection();
			consultas = new Consultas(conn);
			return consultas.getAtributoEspecificos(strSubprograma, opcion);
		} catch (NamingException e) {
			throw new DAOException(e);
		} catch (SQLException e) {
			throw new DAOException(e);
		} finally {
			if (consultas != null) {
				if (!consultas.isConnClosed()) {
					consultas.close();
				}
			}
		}
	}

	public Collection<ValorFlexibleVO> getDominio(String tipovfl)
			throws DAOException {
		Consultas consultas = null;
		try {
			Connection conn = ConexionFactory.getInstance().getConnection();
			consultas = new Consultas(conn);
			return consultas.getDominio(tipovfl);
		} catch (NamingException e) {
			throw new DAOException(e);
		} catch (SQLException e) {
			throw new DAOException(e);
		} finally {
			if (consultas != null) {
				if (!consultas.isConnClosed()) {
					consultas.close();
				}
			}
		}
	}

	public Collection<ValorFlexibleVO> getDominioByCritera(String tipovfl,
			String nombre) throws DAOException {
		Consultas consultas = null;
		try {
			Connection conn = ConexionFactory.getInstance().getConnection();
			consultas = new Consultas(conn);
			return consultas.getDominioByCritera(tipovfl, nombre);
		} catch (NamingException e) {
			throw new DAOException(e);
		} catch (SQLException e) {
			throw new DAOException(e);
		} finally {
			if (consultas != null) {
				if (!consultas.isConnClosed()) {
					consultas.close();
				}
			}
		}
	}

	public Collection<String> GetTvflAtri(String codigo) throws DAOException {
		Consultas consultas = null;
		try {
			Connection conn = ConexionFactory.getInstance().getConnection();
			consultas = new Consultas(conn);
			return consultas.GetTvflAtri(codigo);
		} catch (NamingException e) {
			throw new DAOException(e);
		} catch (SQLException e) {
			throw new DAOException(e);
		} finally {
			if (consultas != null) {
				if (!consultas.isConnClosed()) {
					consultas.close();
				}
			}
		}
	}

	public Collection<Atributo> getAtriValidarLista(List<String> lNombre,
			String strSubprograma) throws DAOException {
		Consultas consultas = null;
		try {
			Connection conn = ConexionFactory.getInstance().getConnection();
			consultas = new Consultas(conn);
			return consultas.getAtriValidarLista(lNombre, strSubprograma);
		} catch (NamingException e) {
			throw new DAOException(e);
		} catch (SQLException e) {
			throw new DAOException(e);
		} finally {
			if (consultas != null) {
				if (!consultas.isConnClosed()) {
					consultas.close();
				}
			}
		}
	}

	public Collection<Atributo> getAtriValidarLista2(List<String> lNombre,
			String strSubprograma) throws DAOException {
		Consultas consultas = null;
		try {
			Connection conn = ConexionFactory.getInstance().getConnection();
			consultas = new Consultas(conn);
			return consultas.getAtriValidarLista2(lNombre, strSubprograma);
		} catch (NamingException e) {
			throw new DAOException(e);
		} catch (SQLException e) {
			throw new DAOException(e);
		} finally {
			if (consultas != null) {
				if (!consultas.isConnClosed()) {
					consultas.close();
				}
			}
		}
	}

	public int InsertAtributo(String[] strArr, String strSubprograma)
			throws DAOException {
		Consultas consultas = null;
		try {
			Connection conn = ConexionFactory.getInstance().getConnection();
			consultas = new Consultas(conn);
			return consultas.InsertAtributo(strArr, strSubprograma);
		} catch (NamingException e) {
			throw new DAOException(e);
		} catch (SQLException e) {
			throw new DAOException(e);
		} finally {
			if (consultas != null) {
				if (!consultas.isConnClosed()) {
					consultas.close();
				}
			}
		}
	}

	public int InsertAtributo2(String[] strArrAG, String strSubprograma)
			throws DAOException {
		Consultas consultas = null;
		try {
			Connection conn = ConexionFactory.getInstance().getConnection();
			consultas = new Consultas(conn);
			return consultas.InsertAtributo2(strArrAG, strSubprograma);
		} catch (NamingException e) {
			throw new DAOException(e);
		} catch (SQLException e) {
			throw new DAOException(e);
		} finally {
			if (consultas != null) {
				if (!consultas.isConnClosed()) {
					consultas.close();
				}
			}
		}
	}

	public int InsertAtributoGenerico(String strCodigo, String strSubprograma,
			String[] strArr2) throws DAOException {
		Consultas consultas = null;
		try {
			Connection conn = ConexionFactory.getInstance().getConnection();
			consultas = new Consultas(conn);
			return consultas.InsertAtributoGenerico(strCodigo, strSubprograma,
					strArr2);
		} catch (NamingException e) {
			throw new DAOException(e);
		} catch (SQLException e) {
			throw new DAOException(e);
		} finally {
			if (consultas != null) {
				if (!consultas.isConnClosed()) {
					consultas.close();
				}
			}
		}
	}

	public int InsertTipoVFL(String[] strArr) throws DAOException {
		Consultas consultas = null;
		try {
			Connection conn = ConexionFactory.getInstance().getConnection();
			consultas = new Consultas(conn);
			return consultas.InsertTipoVFL(strArr);
		} catch (NamingException e) {
			throw new DAOException(e);
		} catch (SQLException e) {
			throw new DAOException(e);
		} finally {
			if (consultas != null) {
				if (!consultas.isConnClosed()) {
					consultas.close();
				}
			}
		}
	}

	public int InsertAtributoGene(String[] strArr) throws DAOException {
		Consultas consultas = null;
		try {
			Connection conn = ConexionFactory.getInstance().getConnection();
			consultas = new Consultas(conn);
			return consultas.InsertAtributoGene(strArr);
		} catch (NamingException e) {
			throw new DAOException(e);
		} catch (SQLException e) {
			throw new DAOException(e);
		} finally {
			if (consultas != null) {
				if (!consultas.isConnClosed()) {
					consultas.close();
				}
			}
		}
	}

	public int InsertValorVFL(String[] strArr, int codigo) throws DAOException {
		Consultas consultas = null;
		try {
			Connection conn = ConexionFactory.getInstance().getConnection();
			consultas = new Consultas(conn);
			return consultas.InsertValorVFL(strArr, codigo);
		} catch (NamingException e) {
			throw new DAOException(e);
		} catch (SQLException e) {
			throw new DAOException(e);
		} finally {
			if (consultas != null) {
				if (!consultas.isConnClosed()) {
					consultas.close();
				}
			}
		}
	}

	public int getCodigoTipoVFL() throws DAOException {
		Consultas consultas = null;
		try {
			Connection conn = ConexionFactory.getInstance().getConnection();
			consultas = new Consultas(conn);
			return consultas.getCodigoTipoVFL();
		} catch (NamingException e) {
			throw new DAOException(e);
		} catch (SQLException e) {
			throw new DAOException(e);
		} finally {
			if (consultas != null) {
				if (!consultas.isConnClosed()) {
					consultas.close();
				}
			}
		}
	}

	public int getOrdenAtriGene() throws DAOException {
		Consultas consultas = null;
		try {
			Connection conn = ConexionFactory.getInstance().getConnection();
			consultas = new Consultas(conn);
			return consultas.getOrdenAtriGene();
		} catch (NamingException e) {
			throw new DAOException(e);
		} catch (SQLException e) {
			throw new DAOException(e);
		} finally {
			if (consultas != null) {
				if (!consultas.isConnClosed()) {
					consultas.close();
				}
			}
		}
	}

	public Collection<String> CodMaxAtriGene() throws DAOException {
		Consultas consultas = null;
		try {
			Connection conn = ConexionFactory.getInstance().getConnection();
			consultas = new Consultas(conn);
			return consultas.CodMaxAtriGene();
		} catch (NamingException e) {
			throw new DAOException(e);
		} catch (SQLException e) {
			throw new DAOException(e);
		} finally {
			if (consultas != null) {
				if (!consultas.isConnClosed()) {
					consultas.close();
				}
			}
		}
	}

	public int getOrden(String Orden, String Subprograma, String vigencia)
			throws DAOException {
		Consultas consultas = null;
		try {
			Connection conn = ConexionFactory.getInstance().getConnection();
			consultas = new Consultas(conn);
			return consultas.getOrden(Orden, Subprograma, vigencia);
		} catch (NamingException e) {
			throw new DAOException(e);
		} catch (SQLException e) {
			throw new DAOException(e);
		} finally {
			if (consultas != null) {
				if (!consultas.isConnClosed()) {
					consultas.close();
				}
			}
		}
	}

	public int getOrden(String Orden, String Subprograma) throws DAOException {
		Consultas consultas = null;
		try {
			Connection conn = ConexionFactory.getInstance().getConnection();
			consultas = new Consultas(conn);
			return consultas.getOrden(Orden, Subprograma);
		} catch (NamingException e) {
			throw new DAOException(e);
		} catch (SQLException e) {
			throw new DAOException(e);
		} finally {
			if (consultas != null) {
				if (!consultas.isConnClosed()) {
					consultas.close();
				}
			}
		}
	}

	public int getNombre(String Nombre, String Subprograma, String vigencia)
			throws DAOException {
		Consultas consultas = null;
		try {
			Connection conn = ConexionFactory.getInstance().getConnection();
			consultas = new Consultas(conn);
			return consultas.getNombre(Nombre, Subprograma, vigencia);
		} catch (NamingException e) {
			throw new DAOException(e);
		} catch (SQLException e) {
			throw new DAOException(e);
		} finally {
			if (consultas != null) {
				if (!consultas.isConnClosed()) {
					consultas.close();
				}
			}
		}
	}

	public int getNombre(String Nombre, String Subprograma) throws DAOException {
		Consultas consultas = null;
		try {
			Connection conn = ConexionFactory.getInstance().getConnection();
			consultas = new Consultas(conn);
			return consultas.getNombre(Nombre, Subprograma);
		} catch (NamingException e) {
			throw new DAOException(e);
		} catch (SQLException e) {
			throw new DAOException(e);
		} finally {
			if (consultas != null) {
				if (!consultas.isConnClosed()) {
					consultas.close();
				}
			}
		}
	}

	public int ActualizarAtributo(String strCodigoAtri, int iCodigo,
			String[] strArrAct) throws DAOException {
		Consultas consultas = null;
		try {
			Connection conn = ConexionFactory.getInstance().getConnection();
			consultas = new Consultas(conn);
			return consultas.ActualizarAtributo(strCodigoAtri, iCodigo,
					strArrAct);
		} catch (NamingException e) {
			throw new DAOException(e);
		} catch (SQLException e) {
			throw new DAOException(e);
		} finally {
			if (consultas != null) {
				if (!consultas.isConnClosed()) {
					consultas.close();
				}
			}
		}
	}

	public int ActualizarAtributoGene(int iCodigoAtri, int iCodigo,
			String[] strArrAct) throws DAOException {
		Consultas consultas = null;
		try {
			Connection conn = ConexionFactory.getInstance().getConnection();
			consultas = new Consultas(conn);
			return consultas.ActualizarAtributoGene(iCodigoAtri, iCodigo,
					strArrAct);
		} catch (NamingException e) {
			throw new DAOException(e);
		} catch (SQLException e) {
			throw new DAOException(e);
		} finally {
			if (consultas != null) {
				if (!consultas.isConnClosed()) {
					consultas.close();
				}
			}
		}
	}

	public int ActualizarCampoUno(int iCodAtriEsp, int iCodAtriGene)
			throws DAOException {
		Consultas consultas = null;
		try {
			Connection conn = ConexionFactory.getInstance().getConnection();
			consultas = new Consultas(conn);
			return consultas.ActualizarCampoUno(iCodAtriEsp, iCodAtriGene);
		} catch (NamingException e) {
			throw new DAOException(e);
		} catch (SQLException e) {
			throw new DAOException(e);
		} finally {
			if (consultas != null) {
				if (!consultas.isConnClosed()) {
					consultas.close();
				}
			}
		}
	}

	public int ActulizarValorSug(String strCodigoAtri, String strCodigoVFL,
			String[] strArrAct) throws DAOException {
		Consultas consultas = null;
		try {
			Connection conn = ConexionFactory.getInstance().getConnection();
			consultas = new Consultas(conn);
			return consultas.ActulizarValorSug(strCodigoAtri, strCodigoVFL,
					strArrAct);
		} catch (NamingException e) {
			throw new DAOException(e);
		} catch (SQLException e) {
			throw new DAOException(e);
		} finally {
			if (consultas != null) {
				if (!consultas.isConnClosed()) {
					consultas.close();
				}
			}
		}
	}

	public int ActulizarValorSugGene(int CodigoAtriGe, String strCodigoVFL)
			throws DAOException {
		Consultas consultas = null;
		try {
			Connection conn = ConexionFactory.getInstance().getConnection();
			consultas = new Consultas(conn);
			return consultas.ActulizarValorSugGene(CodigoAtriGe, strCodigoVFL);
		} catch (NamingException e) {
			throw new DAOException(e);
		} catch (SQLException e) {
			throw new DAOException(e);
		} finally {
			if (consultas != null) {
				if (!consultas.isConnClosed()) {
					consultas.close();
				}
			}
		}
	}

	public int EliminarAtri(String strCodigoAtri, String[] strArrAct)
			throws DAOException {
		Consultas consultas = null;
		try {
			Connection conn = ConexionFactory.getInstance().getConnection();
			consultas = new Consultas(conn);
			return consultas.EliminarAtri(strCodigoAtri, strArrAct);
		} catch (NamingException e) {
			throw new DAOException(e);
		} catch (SQLException e) {
			throw new DAOException(e);
		} finally {
			if (consultas != null) {
				if (!consultas.isConnClosed()) {
					consultas.close();
				}
			}
		}
	}

	public int ModificarAtriSub(Atributo Atri, String[] strArrAct)
			throws DAOException {
		Consultas consultas = null;
		try {
			Connection conn = ConexionFactory.getInstance().getConnection();
			consultas = new Consultas(conn);
			return consultas.ModificarAtriSub(Atri, strArrAct);
		} catch (NamingException e) {
			throw new DAOException(e);
		} catch (SQLException e) {
			throw new DAOException(e);
		} finally {
			if (consultas != null) {
				if (!consultas.isConnClosed()) {
					consultas.close();
				}
			}
		}
	}

	public int ActualizarTvfDominio(String Atri) throws DAOException {
		Consultas consultas = null;
		try {
			Connection conn = ConexionFactory.getInstance().getConnection();
			consultas = new Consultas(conn);
			return consultas.ActualizarTvfDominio(Atri);
		} catch (NamingException e) {
			throw new DAOException(e);
		} catch (SQLException e) {
			throw new DAOException(e);
		} finally {
			if (consultas != null) {
				if (!consultas.isConnClosed()) {
					consultas.close();
				}
			}
		}
	}

	public int ActualizarDominio(String[] strArr, String Codigo)
			throws DAOException {
		Consultas consultas = null;
		try {
			Connection conn = ConexionFactory.getInstance().getConnection();
			consultas = new Consultas(conn);
			return consultas.ActualizarDominio(strArr, Codigo);
		} catch (NamingException e) {
			throw new DAOException(e);
		} catch (SQLException e) {
			throw new DAOException(e);
		} finally {
			if (consultas != null) {
				if (!consultas.isConnClosed()) {
					consultas.close();
				}
			}
		}
	}

	public int ActualizarValorFlexible(String[] strArr, String Codigo)
			throws DAOException {
		Consultas consultas = null;
		try {
			Connection conn = ConexionFactory.getInstance().getConnection();
			consultas = new Consultas(conn);
			return consultas.ActualizarValorFlexible(strArr, Codigo);
		} catch (NamingException e) {
			throw new DAOException(e);
		} catch (SQLException e) {
			throw new DAOException(e);
		} finally {
			if (consultas != null) {
				if (!consultas.isConnClosed()) {
					consultas.close();
				}
			}
		}
	}

	public int EliminarVFL(String Codigo) throws DAOException {
		Consultas consultas = null;
		try {
			Connection conn = ConexionFactory.getInstance().getConnection();
			consultas = new Consultas(conn);
			return consultas.EliminarVFL(Codigo);
		} catch (NamingException e) {
			throw new DAOException(e);
		} catch (SQLException e) {
			throw new DAOException(e);
		} finally {
			if (consultas != null) {
				if (!consultas.isConnClosed()) {
					consultas.close();
				}
			}
		}
	}

	public int EliminarVFLTotal(String Codigo) throws DAOException {
		Consultas consultas = null;
		try {
			Connection conn = ConexionFactory.getInstance().getConnection();
			consultas = new Consultas(conn);
			return consultas.EliminarVFLTotal(Codigo);
		} catch (NamingException e) {
			throw new DAOException(e);
		} catch (SQLException e) {
			throw new DAOException(e);
		} finally {
			if (consultas != null) {
				if (!consultas.isConnClosed()) {
					consultas.close();
				}
			}
		}
	}
}
